from django.test import TestCase

# Create your tests here.
# 第一步：导入Redis类
from redis import Redis

# 第二部: 实例化得到对象
conn = Redis(host="localhost", port=6379, )
list_length = conn.llen('gg')
old_length = str(conn.get('length'), 'utf-8')
res = int(list_length) - int(old_length)
gg_list = []
if res > 0:
    for i in range(0, res-1):
        obj = str(conn.lpop('gg'), 'utf-8')
        gg_list.append(obj)
print(gg_list)
conn.close()
